      SUBROUTINE SETUP
      RETURN
      END
C   HS25
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      INTEGER I 
      DOUBLE PRECISION DATA,DATB
      COMMON /DAT/ DATA(99),DATB(99)
      SAVE /DAT/
      DOUBLE PRECISION X(NX),FX,UI,VIX,ARG,FI
      ICF=ICF+1
      IF(ICF .NE. 1)      GOTO 50
      CALL SETDAT
   50 CONTINUE
      FX=0.D0
      DO      100      I=1,99
      UI=DATA(I)
      VIX=0.D0
      ARG=-(UI-X(2))**X(3)/X(1)
      IF(ARG .GT. -170.D0)    VIX=DEXP(ARG)
      FI=DATB(I)+VIX
      FX=FX+FI**2
  100 CONTINUE
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      INTEGER J
      DOUBLE PRECISION DATA,DATB
      COMMON /DAT/ DATA(99),DATB(99)
      SAVE /DAT/
      DOUBLE PRECISION X(NX),GRADF(NX),XK,UIX,VIX,ARG,FI1,FI2,FI3,UI
      ICGF=ICGF+1
      DO      10      J=1,3
      GRADF(J)=0.D0
   10 CONTINUE
      DO     100      J=1,99
      UI=DATA(J)
      XK=-1.D0/X(1)
      UIX=UI-X(2)
      VIX=XK*UIX**X(3)
      ARG=0.D0
      IF(VIX .GT. -170.D0)     ARG=DEXP(VIX)
      ARG=2.D0*(DATB(J)+ARG)*ARG
      FI1=-ARG*VIX/X(1)
      FI2=-ARG*VIX*X(3)/UIX
      FI3= ARG*VIX*DLOG(UIX)
      GRADF(1)=GRADF(1)+FI1
      GRADF(2)=GRADF(2)+FI2
      GRADF(3)=GRADF(3)+FI3
  100 CONTINUE
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GXI
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      GOTO(100,200,200,400,500,600),I
  100 CONTINUE
      GXI= X(1)-.1D0
      RETURN
  200 CONTINUE
      GXI= X(I)
      RETURN
  400 CONTINUE
      GXI=100.D0-X(1)
      RETURN
  500 CONTINUE
      GXI=25.6D0-X(2)
      RETURN
  600 CONTINUE
      GXI= 5.0D0-X(3)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX) ,GRADGI(NX)
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      DO      10      J=1,3
      GRADGI(J)=0.D0
  10  CONTINUE
      IF(I .GT. 3)          GOTO 100
      GRADGI(I)= 1.D0
      RETURN
  100 CONTINUE
      GRADGI(I-3)=-1.D0
      RETURN
      END
      SUBROUTINE SETDAT
      IMPLICIT NONE
      DOUBLE PRECISION DATA,DATB
      INTEGER I
      INTRINSIC LOG
      COMMON /DAT/ DATA(99),DATB(99)
      SAVE /DAT/
      DO      100      I=1,99
      DATA(I)=25.D0+(-50.D0*LOG(.01D0*DBLE(I)))**.666666666666666D0
      DATB(I)=-DBLE(I)*1.D-2
  100 CONTINUE
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS25'/
C      DATA X(1),X(2),X(3)/100.D0,12.5D0,3.0D0/
      DATA X(1),X(2),X(3)/70.D0,7.5D0,2.0D0/
      DATA N/3/ , NH/0/ , NG/ 6/
      DATA DEL0/1.D0/ ,TAU0/1.D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,6)/-1,0,0,
     F           1,1,1,1,2,1,1,3,1,1,1,-1,1,2,-1,1,3,-1/
      END
